#include "algorithm.h"

algorithm::algorithm()
{
}

bool algorithm::alg1_1_1()
{
	double data[3][3]={{45},{78,98},{12,68,15}};
	double b[3]={12,25,48.2};
	double y[3];	
	double temp;
	for(int i=0;i<3;i++)
	{
		temp=0;
		for(int j=0;j<i;j++)
			temp+=data[i][j]*y[j];
		y[i]=(b[i]-temp)/data[i][i];
	}
	cout<<y[0]<<' '<<y[1]<<' '<<y[2]<<endl;
	return true;
}